﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Practices.Unity;
using Praxis.Entities;
using Praxis.BusinessLogic;

namespace Praxis.UI
{
    public partial class FrmComprobantes : Form
    {
        [Dependency]
        public IComprobanteBL comprobanteBL { get; set; }

        public FrmComprobantes()
        {
            InitializeComponent();
            this.BuildUp();
        }

        private void BtnNuevo_Click(object sender, EventArgs e)
        {
            FrmMttoPago frm = new FrmMttoPago();
            frm.Show();
            this.Hide();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            FrmPagos frm = new FrmPagos();
            frm.Show();
        }

        private void BtnEditarComp_Click(object sender, EventArgs e)
        {
            FrmMttoComprobante frm = new FrmMttoComprobante();
        }

        private void FrmComprobantes_Load(object sender, EventArgs e)
        {
            cOMPROBANTEBindingSource.DataSource = comprobanteBL.GetAllComprobantes();
        }

        private void btnBusCliente_Click(object sender, EventArgs e)
        {
            cOMPROBANTEBindingSource.DataSource = comprobanteBL.GetComprobanteByCriterio(TxtDescripcion.Text);
        }

        private void TxtDescripcion_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                cOMPROBANTEBindingSource.DataSource = comprobanteBL.GetComprobanteByCriterio(TxtDescripcion.Text);
            }
        }
    }
}
